package com.victualler.business.inventory.controller;

import com.victualler.business.inventory.dto.InventoryOrderInfoDto;
import com.victualler.business.inventory.dto.request.InventoryRequestDto;
import com.victualler.business.inventory.entity.InventoryOrderDao;
import com.victualler.business.inventory.repository.InventoryOrderQueryRepository;
import com.victualler.business.inventory.repository.InventoryOrderRepository;
import com.victualler.business.inventory.service.InventoryOrderService;
import com.victualler.core.base.controller.BaseRestController;
import com.victualler.core.common.dto.PageDto;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletResponse;


/**
 * @author: Guoshichang
 * @discription:
 */
public interface InventoryOrderController  extends BaseRestController<InventoryOrderDao,InventoryOrderRepository,InventoryOrderQueryRepository,InventoryOrderService> {


    /**
     * @author Guoshichang
     * @since 13:39 on 2018/7/7.
     * @param inventoryRequestDto 请求对象
     * @Function  根据条件入参prePurchaseRequestDto动态分页查询权限
     */
    @RequestMapping("/getByRequestDto")
    public PageDto<InventoryOrderDao> getByRequestDto(@RequestBody InventoryRequestDto inventoryRequestDto, @RequestParam("pageNo") int pageNo, @RequestParam("limit") int limit);

    /**
     * @author Guoshichang
     * @since 13:39 on 2018/7/7.
     * @param id 预订单id
     * @Function  根据条件入参prePurchaseRequestDto动态分页查询权限
     */
    @RequestMapping("/findInfo/{id}")
    public InventoryOrderInfoDto findInfo(@PathVariable("id") Long id);

    /**
     * @author Guoshichang
     * @since 13:39 on 2018/7/7.
     * @param inventoryOrderInfoDto 预订单实体大对象
     * @Function  保存预订单实体大对象
     */
    @RequestMapping("/saveInfo")
    public void saveInfo(@RequestBody InventoryOrderInfoDto inventoryOrderInfoDto);

    /**
     * @author Guoshichang
     * @since 18:01 on 2018/10/9.
     * @param inventoryOrderDao 审查大对象
     * @return
     * @Function
     */
    @RequestMapping("/check")
    public void check(@RequestBody InventoryOrderDao inventoryOrderDao);

    /**
     * @author Guoshichang
     * @since 13:39 on 2018/7/7.
     * @param id 预订单id
     * @Function  根据条件入参prePurchaseRequestDto动态分页查询权限
     */
    @RequestMapping("/deleteInfo/{id}")
    public void deleteInfo(@PathVariable("id") Long id);


    /**
     * @author Guoshichang
     * @since 19:54 on 2018/7/23.
     * @param response 存放文件的 输出流
     * @param orderNo 订单号
     * @Function 将文件从影像系统下载下来并且打印返回到response的流中
     */
    @RequestMapping("/exportFile/{orderNo}")
    public void exportFile(@PathVariable("orderNo") String orderNo, HttpServletResponse response);
}
